//
//  UIMySearchBar.m
//  QGSPos
//
//  Created by QGSVN42 on 5/10/12.
//  Copyright (c) 2012 QGS Inc.. All rights reserved.
//

#import "UIMySearchBar.h"
#import <QuartzCore/QuartzCore.h>
@implementation UIMySearchBar
@synthesize red,green,blue;
@synthesize fromView;
@synthesize myBackgroundColor;

// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    UIImageView *bgrView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
//    bgrView.backgroundColor = [UIColor colorWithRed:(float)red/255 green:(float)green/255 blue:(float)blue/255 alpha:1];
    
    if (fromView == 1) { //building mgmt
        bgrView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"grayPattern.png"]];
    }
    else {
        bgrView.backgroundColor = [UIColor colorWithRed:(float)red/255 green:(float)green/255 blue:(float)blue/255 alpha:1];
    }
    [self insertSubview:bgrView atIndex:1];
    self.layer.borderWidth = 0;
    self.layer.borderColor = [[UIColor clearColor] CGColor];
}


@end
